package huang.com.android.logactivitys;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class LogAcitvitys extends AppCompatActivity {
    /** Called when the activity is first created. */
    private Button myButton;
    static final String LIFE_TAG="LogActivitys";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log_acitvitys);
        Log.v(LogAcitvitys.LIFE_TAG, "First  ---> onCreate");
        Button myButton = (Button) findViewById(R.id.myButton);
        myButton.setText("启动第二个Activity");
        myButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent();
                intent.setClass(LogAcitvitys.this, LogActivity2.class);
                LogAcitvitys.this.startActivity(intent);
            }
        } );
    }
    @Override
    protected void onDestroy(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"firstActivity  --->onDestory");
        super.onDestroy();
    }

    @Override
    protected void onPause(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"FirstAcvity --->onPause");
        super.onPause();
    }

    @Override
    protected void onRestart(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"FirstAcvity --->onRestart");
        super.onRestart();
    }

    @Override
    protected void onResume(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"FirstAcvity --->onResume");
        super.onResume();

    }

    @Override
    protected void onStart(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"FirstAcvity --->onStart");
        super.onStart();
    }

    @Override
    protected void onStop(){
        // TODO Auto-generated method stub
        Log.v(LogAcitvitys.LIFE_TAG,"FirstAcvity --->onStop");
        super.onStop();

    }
}
